<?php

    require ('init.php');
    require ('header.php');

    $vente_privees = VentePrivee::getVentePrivees(true, true);
     echo '<div id="gestion"  class= "container_12">';
    echo '<a class="grid_4 alpha" href="detail_vente_privee.php">
    .     <img alt="#" src="../img/ajouter.png" title="Ajouter" class="btn_ajouter" width="30"/>
          Ajouter une vente privée</a>';
    echo '</div>';
    echo    '<div class= "container_12">';
    echo    '<table class="grid_12" cellspacing="0">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>Nom</th>
                    <th>Date début</th>
                    <th>Date de fin</th>   
                    <th>Gérer</th>
                </tr>
            </thead>
            <tbody>';
    
    foreach($vente_privees as $vps) {
        echo    '<tr>
                    <td>'.$vps->getId().'</td>
                    <td>'.$vps->getLibelle().'</td>
                    <td>'.$vps->getDateDebut('d/m/Y H:i:s').'</td>
                    <td>'.$vps->getDateFin('d/m/Y H:i:s').'</td>
                    <td><a href="detail_vente_privee.php?id='.$vps->getId().'">Gérer</td>
                 </tr>';

    }
    echo    '</tbody>
        </table>
        </div>';

?>